/*
 * @Author: your name
 * @Date: 2020-11-23 10:19:14
 * @LastEditTime: 2020-11-23 10:32:59
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \book-store1901-app\src\api\init.js
 */
import LC from 'leancloud-storage' // 导入leancloud 的数据存储 SDK
import config from './config/lc.config' // 导入配置文件

let initOptions

if (config.url.trim() === '') {
  // 如果 url 为空，则表示访问国际版：leancloud.app
  initOptions = {
    appId: config.id,
    appKey: config.key
  }
} else {
  // 包含 url 时，则表示访问国内版：leancloud.cn
  initOptions = {
    appId: config.id,
    appKey: config.key,
    serverURLs: config.url
  }
}
LC.init(initOptions) // leancloud 执行初始化

export default {}
